import Mock from 'mockjs'
function randomColor () {
  return '#' + Math.random().toString(16).substr(2, 6).toUpperCase();
}
const top = []
export default ({ mock }) => {
  if (!mock) return;
  Mock.mock('/user/getMenu', 'get', (res) => {
    let body = JSON.parse(res.body);
    return {
      data: menu[body.type] || []
    }
  })
  Mock.mock('/user/getTopMenu', 'get', () => {
    return {
      data: top
    }
  })
}